package com.slz3.business.module.messageManagement.mesOrder.steward;

import com.slz3.business.frame.response.RR;
import com.slz3.business.frame.response.ResInfo;
import com.slz3.business.module.messageManagement.mesOrder.domain.MesOrder;
import com.slz3.business.module.messageManagement.mesOrder.domain.MesOrderCondition;
import org.springframework.stereotype.Component;
import org.springframework.web.reactive.function.server.ServerRequest;
import org.springframework.web.reactive.function.server.ServerResponse;
import reactor.core.publisher.Mono;

@Component
public class MesOrderResAtomic {

    public Mono<ServerResponse> add_$MesOrderUpdateLock(ServerRequest req, MesOrder mesOrder) {
        return MesOrderResSafeValid.add(req, mesOrder) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.add(req, mesOrder);
    }

    public Mono<ServerResponse> delete_$MesOrderUpdateLock(ServerRequest req, MesOrderCondition mesOrderCondition) {
        return MesOrderResSafeValid.delete(req, mesOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.delete(req);
    }

    public Mono<ServerResponse> modify_$MesOrderUpdateLock(ServerRequest req, MesOrder mesOrder) {
        return MesOrderResSafeValid.modify(req, mesOrder) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.modify(req, mesOrder);
    }

    public Mono<ServerResponse> info_$MesOrderUpdateLock(ServerRequest req) {
        return MesOrderResSafeValid.info(req) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.info(req);
    }

    public Mono<ServerResponse> auditSubmit_$MesOrderUpdateLock(ServerRequest req, MesOrderCondition mesOrderCondition) {
        return MesOrderResSafeValid.auditSubmit(req, mesOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.auditSubmit(req);
    }

    public Mono<ServerResponse> audit_$MesOrderUpdateLock(ServerRequest req, MesOrderCondition mesOrderCondition) {
        return MesOrderResSafeValid.audit(req, mesOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.audit(req);
    }

    public Mono<ServerResponse> auditReject_$MesOrderUpdateLock(ServerRequest req, MesOrderCondition mesOrderCondition) {
        return MesOrderResSafeValid.auditReject(req, mesOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.auditReject(req);
    }


    public Mono<ServerResponse> usingEnable_$MesOrderUpdateLock(ServerRequest req, MesOrderCondition mesOrderCondition) {
        return MesOrderResSafeValid.usingEnable(req, mesOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.usingEnable(req);
    }

    public Mono<ServerResponse> usingDisable_$MesOrderUpdateLock(ServerRequest req, MesOrderCondition mesOrderCondition) {
        return MesOrderResSafeValid.usingDisable(req, mesOrderCondition) ?
                RR.fail(req, ResInfo.builder().theme(RR.SAFE_VALID).build()) :
                MesOrderResExecutor.usingDisable(req);
    }
}
